package com.itpuyang.single;

import javax.xml.transform.OutputKeys;

public class LazyMan {

    private  static LazyMan lazyMan;
    private  static LazyMan lazyMan01;

    private LazyMan(){
        System.out.println(Thread.currentThread().getName() + "ok");
    }

    public static LazyMan getInstance(){
//        if (lazyMan == null){
//            synchronized (LazyMan.class){
                if (lazyMan == null){
                    LazyMan lazyMan = new LazyMan();
                }
//            }
//        }
        return lazyMan;
    }

    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
            new Thread(()->{
                LazyMan.getInstance();
            }).start();
        }
    }
}

